<?php

require("includes/funciones.inc.php");
require("includes/constants.php");

$DB = NewADOConnection('mysqlt');
$DB->Connect();
$DB->Execute("SET NAMES utf8;");
//$DB->debug=true;

$strSQL = "SELECT description, weatherCode FROM ptosuelta";
$rsPtoSuelta = $DB->Execute($strSQL);

$strSelectPtoSuelta = "<select name='cmbPtoSuelta' id='cmbPtoSuelta' onchange='\$_cargaWeather();'>";
$strSelectPtoSuelta .= "<option value='0'>...</option>";
while(!$rsPtoSuelta->EOF){
	$strSelectPtoSuelta .= "<option value='" . $rsPtoSuelta->fields("weatherCode") . "'>" . $rsPtoSuelta->fields("description") . "</option>";
	$rsPtoSuelta->MoveNext();
}
$strSelectPtoSuelta .= "</select>";
?>
<p class="spanLog">Estado del Clima</p>
<span class="textPopHeaderTable">Punto de Suelta: </span><?=$strSelectPtoSuelta?>
<table width="97%">
	<tr>
		<td align="center"><div id="clima1"></div></td>
	</tr>
</table>

<script type="text/javascript">
 	function $_cargaWeather() 
 	{
 		$('#clima1').weatherfeed([$('#cmbPtoSuelta').val()],{
 				forecast: true, 
 				woeid: true, 
 				highlow: true,
				wind: true,
				humidity: true,
				visibility: true,
				sunrise: true,
				sunset: true,
		});	
 	}
</script>